﻿
Imports System.Data.OleDb
Public Class DeleteDocument

 
    Private Sub DeleteDocument_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim strSQL2 As String = "SELECT * FROM Document "


        Try
            Using adapter2 As New OleDbDataAdapter(strSQL2, My.Settings.DigitalDocumentConnectionString)


                Dim ds2 As New DataSet
                adapter2.Fill(ds2, "Document")


                Me.DeListBox.DataSource = ds2.Tables("Document")
                Me.DeListBox.ValueMember = "DId"
                Me.DeListBox.DisplayMember = "Title"


            End Using
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
      
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim deldoc As String = DeListBox.SelectedValue.ToString

        MsgBox(deldoc)
        Me.DocumentTableAdapter.DeleteDoc(deldoc)


    End Sub




    Private Sub DeListBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeListBox.SelectedIndexChanged

    End Sub


End Class